package com.sunfeng.gulimall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sunfeng.common.utils.PageUtils;
import com.sunfeng.gulimall.product.entity.CategoryEntity;
import com.sunfeng.gulimall.product.vo.Catalog2Vo;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author sunfeng
 * @email 18354680214@163.com
 * @date 2021-07-16 22:45:54
 */
public interface CategoryService extends IService<CategoryEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     *  分类的树形结构
     * @return
     */
    List<CategoryEntity> listWithTree();

    Long[] findCatelogPath(Long catelogId);

    /**
     * 级联更新所有数据
     * @param category
     */
    void updateCascade(CategoryEntity category);

    List<CategoryEntity> getLevel1Categorys();

    /**
     *  获取2及分类Json
     * @return
     */
    Map<String, List<Catalog2Vo>> getCatalogJson();
}

